<%@ page import="com.Renting.controller.Login" %>
<%@ page import="javax.annotation.Resource" %>
<%@ page import="com.Renting.service.impl.ServiceLoginImpl" %>
<%@ page import="com.Renting.service.ServiceLogin" %>
<%@ page import="com.Renting.service.impl.ServiceGainImpl" %>
<%@ page import="com.Renting.domain.Renting" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--导入JSTL标签库--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title>信院租房</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/webjars/jquery/3.3.1-2/jquery.min.js"></script>

    <style>
        .col-lg-2:hover
        {
            border: 2px solid #2E9AFE;
            color: #2EFE2E;
        }
    </style>
</head>
<body>


<div class="container" style="background-color: #F2F2F2;">
    <!-- 在row里面，默认会把一行分为12块 -->
    <div class="row">
        <div class="col-lg-9">
            <ul class="nav nav-tabs">
                <li class="active"><a href="/shop.jsp">全部</a></li>
                <li><a href="/RentingInquire.do?attribute=0">单间</a></li>
                <li><a href="/RentingInquire.do?attribute=1">两室一厅</a></li>
                <li><a href="/RentingInquire.do?attribute=2">五室二厅</a></li>
                <li><a href="/MyRenting.do">我已预定</a></li>
                <li><a href="/MyRoom.do">我已缴费</a></li>
                <li style="color: red"><h4>${hint}</h4></li>
            </ul>
        </div>
        <div class="col-lg-3" style="height: 45px;"><h4>
            欢迎您,<a style="color: red"> ${sessionScope.Message.pname}</a>&nbsp;&nbsp;&nbsp;
            <a href="/Quit.do">退出</a>
        </h4></div>
    </div>
    <div class="row">

        <c:forEach items="${ListRenting}" var="result">

            <div class="col-lg-2" onclick="EventClick(this.id)" style="height: 240px;" id=${result.number}>
                <img src="img/a1.jpg" height="180px" width="100%" />
                <p><h5 align="center" style="color: red">￥${result.price}/天</h5></p>
                <p><h5 align="center" style="font-weight:bold">${result.pname}</h5></p>
            </div>
        </c:forEach>

    </div>
</div>
</body>
<script>


    function EventClick(id){
        $.ajax({
            url:"/RentingSubscribe.do",
            type:"post",
            data:{
                number:id
            },
            success:function (data) {
                alert(data);
            }
        });
    }

</script>

</html>

